<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="http://www.baidu.com">
        <input type="text" id="text">
        <input type="reset">
        <input type="submit" value="登录">
    </form>
    <script>
        var form = document.querySelector("form")
        var inp = document.querySelector("input")
        /* 输入事件 输入一个,触发一次 */
        // inp.oninput = function(){console.log("输入事件");}
        /* 改变 当鼠标离开的时候,和原先不一样,那么就触发事件*/
        // inp.onchange = function(){console.log("改变事件");}

        //重置事件
        // form.onreset = function(){console.log("你刚刚点击了重置按钮,触发了这事件");}
        //提交事件
        // form.onsubmit = function(){console.log("你刚刚提交了");}

        //获取焦点
        // inp.onfocus = function(){console.log("获取焦点");}
        //失去焦点
        // inp.onblur = function(){console.log("失去焦点");}

    </script>
</body>
</html>